package cn.wolfcode.wolf2w.business.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyRabbitConfig {

    @Bean
    Queue travelQueue(){
        return new Queue("travelQueue",true,false,false);
    }

    @Bean
    FanoutExchange fanoutExchange(){
        return new FanoutExchange("travelExchange",true,false);
    }

    @Bean
    Binding travelBinding(){
        return new Binding("travelQueue",Binding.DestinationType.QUEUE,
                "travelExchange","",null);
    }
}
